Preparation

Load data, helper functions

source("analysis_helpers.R")
library(lubridate)
library(forcats) #zum neu Ordnen der Faktor-levels ex_label mit fct_relevel()
library(plotly)
library(htmltools)#to plot a series of plotly graphs through a for loop, see https://forum.posit.co/t/display-plotly-graph-produced-in-a-for-loop-in-rmakrdown-html/168188

tracking_data <- load_app_sessions_tracking_data(c("36263541b9", "e47a7d46bf"), c("treat", "ctrl"))
track_sess_times <- tracking_sess_times(tracking_data)
#plot_tracking_sess_durations(track_sess_times)

Limit tracking session events to exercise time frame

# conversion to the right timezone is extremely important!
# all times in `tracking_data` are in UTC (aka GMT)
starttime <- ymd_hm("2024-05-15 11:55", tz = "UTC")
endtime <- ymd_hm("2024-05-15 15:00", tz = "UTC")

tracking_data <- filter(tracking_data, track_sess_start >= starttime, event_time >= starttime, event_time <= endtime) |>
    group_by(track_sess_id) |>
    mutate(track_sess_end = min(track_sess_end, max(event_time))) |>
    ungroup()

track_sess_times <- tracking_sess_times(tracking_data)
plot_tracking_sess_durations(track_sess_times)

plot_tracking_sess_durations(track_sess_times, by_user_code = TRUE)

  • first user: 2 tabs?
  • short user session in middle: lab computer problem
  • short user sessions at the end: restart at the end to show something to the instructor
  • dismiss short sessions?
  • merge 6ab33… and 9cd0…?
  • merge f93a… two sessions?
tracking_data <- filter(tracking_data, !(user_code %in% c("13d48be01652b32e", "1e8e8090e4bc1355", "9cd0199df2050778")))
track_sess_times <- tracking_sess_times(tracking_data)

Plot user ID vs. time of question submission (one graph for each question)

plot_submission_times_questions(loop_over = quo(ex_label),
                                loop_over_list = unique(quest_data$ex_label),
                                group_by_variable = quo(user_code),
                                quest_data=quest_data)

Plot question vs. time of question submission (one graph for each student)

plot_submission_times_questions(loop_over = quo(user_code),
                                loop_over_list = unique(quest_data$user_code),
                                group_by_variable = quo(ex_label),
                                quest_data=quest_data)